package cn.snowheart.decorator.javaio;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Objects;

/**
 * @author liuwanxiang
 * @version 2019/06/27
 */
public class LowerCaseInputStreamTests {

    public static void main(String[] args) throws IOException {
        String filePath = Objects.requireNonNull(LowerCaseInputStreamTests.class.getClassLoader().getResource("file.txt")).getPath();
        File file = new File(filePath);
        if (file.exists()) {
            FileInputStream fis = new FileInputStream(file);
            LowerCaseInputStream lis = new LowerCaseInputStream(fis);
            int c;
            while ((c = lis.read()) != -1) {
                System.out.print((char) c);
            }
            lis.close();
        }
    }

}
